//
//
//
//
//
//
//
//
//
//
//
//

import { mapGetters, mapActions } from "vuex";
import xinyun28 from "./xinyun28/xinyun28";
import pk10 from "./pk10/pk10";
import ssc from "./ssc/ssc";
import lhc from "./lhc/lhc";
import niuniu from "./niuniu/niuniu";
import shaiBao from "./shaiBao/shaiBao";
import kuaiSan from "./kuaiSan/kuaiSan";
import _ from "lodash";
import template from "./playMethodsTemplate";
const { render, staticRenderFns } = template;

export default {
  render,
  staticRenderFns,
  props: ["newLotResult"],
  data() {
    return {
      lottery_type: this.$route.query.lottery_type,
      oddsData: {}, //赔率信息
      betMoneyList: [], //筹码列表
      musicList: [], //音频列表
      lDragonData: [],
    };
  },
  created() {},
  mounted() {
    // 问题1: 由于彩种是24，所以数据获取不到
    this.$http
      .post(this.urlRequest + "?m=api&c=odds&a=getOdds", {
        room_id: this.$route.query.id,
      })
      .then((result) => {
        //获取赔率信息
        if (result.code == 0) {
          this.oddsData = result.data;
          this.getLRatio();
        }
      });
    this.$http
      .post(this.urlRequest + "?m=api&c=openAward&a=getBetting", {})
      .then((result) => {
        if (_.isEmpty(result)) {
          return;
        }
        console.log(result.list, "result.data");
        this.betMoneyList = result.list;
        this.musicList = result.music;
      });
  },
  computed: {
    ...mapGetters(["roomData"]),
  },
  methods: {
    getLRatio: function () {
      this.$http
        .post(this.urlRequest + "?m=api&c=app&a=getLongDragonOdds", {
          lottery_type: this.$route.query.lottery_type,
          room_id: this.$route.query.id,
        })
        .then((result) => {
          if (_.isEmpty(result)) {
            //无数据
            return;
          }
          //this.lDragonData = result.data
        });
    },
  },
  components: {
    xinyun28,
    pk10,
    ssc,
    lhc,
    niuniu,
    shaiBao,
    kuaiSan,
  },
  watch: {
    newLotResult: function (newVal) {
      if (newVal) {
        this.getLRatio();
      }
    },
  },
  deactivated() {},
  beforeDestroy() {},
};

// WEBPACK FOOTER //
// ./src/components/room/playMethods/playMethods.vue
